#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#define BUF_SIZE 1024

int main(int arg1, char* arg2[]){
	
	FILE *fp1, *fp2;
	if(arg1<3){
		printf("please input the filename or dir\n");
		exit(0);
	}
	fp1=fopen(arg2[1],"rt");
	if(fp1==NULL){
		printf("can not find the file\n");
		exit(0);
	}
	strcat(arg2[2],arg2[1]);
	fp2=fopen(arg2[2],"wt");
	if(fp2==NULL){
		printf("can not find the dir\n");
		exit(0);
	}
	
	char buf[BUF_SIZE];
	int n=1;
	while(n>0){
		n=fread(buf,1,BUF_SIZE,fp1);
		fwrite(buf,1,n,fp2);
	}
	return 0;	
	
}
